﻿package com.javaPattern.ObserverJDK;

import java.util.Observable;

class Children extends Observable {
	String state;

	public String getState() {
		return state;
	}

	public void setState(String s) {
		this.state = s;

		setChanged();// 通过setChanged()方法标明对象的状态已发生变化
		this.notifyObservers(state);// 通知各Observer，并发送对象的消息
	}
}
